// import 'reflect-metadata'
// import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm'
import { EntitySchema } from 'typeorm'

// @Entity()
// export class User {
//   @PrimaryGeneratedColumn({ type: 'int', comment: '用户id' })
//   id: number

//   @Column({ nullable: true })
//   name: string

//   @Column({ nullable: true })
//   age: number
// }

export const User = new EntitySchema({
  name: 'User',
  columns: {
    id: {
      type: 'int',
      primary: true,
      generated: true,
      comment: '用户id'
    },
    name: {
      type: 'varchar',
      nullable: true
    },
    age: {
      type: 'int',
      nullable: true
    }
  }
})
